﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="GroupUsers.aspx.cs" Inherits="AspNetTraining.GroupUsers" %>

<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <asp:GridView ID="gvGroupUsers" runat="server" Width="855px" BorderStyle="Solid"
        ShowFooter="True"
        CellPadding="4" ForeColor="#333333" AutoGenerateColumns="False" Height="195px">
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:Label ID="lblGroupUserID" runat="server" Visible="false"
                        Text='<%#Eval("GroupUserID")%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Group Name">
                <ItemTemplate>
                    <a ID="hlEdit"href="GroupUserDetail.aspx?id=<%# Eval("GroupUserID") %>"><%#Eval("GroupName")%></a> 
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="CreatedOn">
                <ItemTemplate>
                    <asp:Label ID="lblCreatedOn" runat="server"
                        Text='<%#String.Format("{0:MM/dd/yy}", Eval("CreatedOn"))%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Created by">
                <ItemTemplate>
                    <asp:Label ID="lblCreatedBy" runat="server"
                        Text='<%#GetUserNameByID(Eval("CreatedBy"))%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="ModifiedOn">
                <ItemTemplate>
                    <asp:Label ID="lblModifiedOn" runat="server"
                        Text='<%#String.Format("{0:MM/dd/yy}", Eval("ModifiedOn"))%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Modified by">
                <ItemTemplate>
                    <asp:Label ID="lblModifiedBy" runat="server"
                        Text='<%#GetUserNameByID(Eval("ModifiedBy"))%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="IsAdmin">
                <ItemTemplate>
                    <asp:Label ID="lblIsAdmin" runat="server"
                        Text='<%#Eval("IsAdmin")%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText="Active">
                <ItemTemplate>
                    <asp:Label ID="lblActive" runat="server"
                        Text='<%#Eval("Active")%>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField>
                <ItemTemplate>
                    <asp:CheckBox ID="chkDeletes" runat="server" />
                    <a id="hlEdit" href="GroupUserDetail.aspx?id=<%# Eval("GroupUserID") %>">Edit</a>
                    <a id="hlDelete" onclick='<%# "return confirm(\"Are you want delete group account?\");" %>' href="GroupUsers.aspx?id=<%# Eval("GroupUserID") %>">Delete</a>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <div>
        <a id="hlCreateNew" href="GroupUserDetail.aspx">Create New</a>
        <asp:LinkButton runat="server" Text="Delete Choose" OnClick="Unnamed_Click" OnClientClick='return confirm(\"Are you want delete account selected ?\");'></asp:LinkButton>
    </div>
</asp:Content>
